Column

Chart A: Distribution of Restaurant’s Score in 2017

data("rest_inspec")

rest_inspec = 
  rest_inspec |> 
  drop_na() 


rest_inspec |> 
  filter(year(inspection_date) == '2017') |> 
  plot_ly(x = ~inspection_date, y = ~score, alpha = 0.4,
          type = "scatter", mode = "markers")

Column

Chart B: Number of Inspections within Each Borough in New York

rest_inspec |> 
  filter(boro !='Missing') |> 
  count(boro) |> 
  mutate(boro = fct_reorder(boro, n)) |>
  plot_ly(x = ~boro, y = ~n, color = ~boro, type = "bar")

Chart C: Distribution of Restaurant’s Inspection Score from 2011 to 2017

data("rest_inspec")

rest_inspec |> 
  mutate(year = year(inspection_date)) |> 
  filter(year %in% c('2013', '2014', '2015', '2016', '2017')) |> 
  plot_ly(x = ~year, y = ~score, type = "box")